package com.gqz.patrol.app.controller;

import com.gqz.common.core.domain.R;
import com.gqz.patrol.app.service.IJfGlService;
import com.gqz.patrol.vo.PatrolJfInfoVo;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description: app-使用-机房管理总接口类
 */
@RestController
@RequestMapping("AppJfGlController")
public class AppJfGlController {

    @Resource(name = "appJfGlService", description = "app-使用-机房管理")
    private IJfGlService jfGlService;

    /**
     * 查询所需机房
     *
     * @return {@link R}<{@link Object}>
     */
    @PostMapping("/queryNeededJfList")
    public R<Object> queryNeededJfList() {
        return jfGlService.queryNeededJfList();
    }

    /**
     * 查询机房设备信息
     *
     * @param jfIds jf ID
     * @return {@link R}<{@link Object}>
     */
    @PostMapping("/queryEquipListByJf")
    public R<Object> queryEquipListByJf(@RequestBody List<String> jfIds) {
        return jfGlService.queryEquipListByJf(jfIds);
    }

    /**
     * 查询机房+机房设备信息
     *
     * @return {@link List}<{@link PatrolJfInfoVo}>
     */
    @PostMapping("/queryJfEquipList")
    public List<PatrolJfInfoVo> queryJfEquipList() {
        return jfGlService.queryJfEquipList();
    }
}
